Thumbnailer, v 1.6

©1995,1996, Preston Holmes

The current version of this document may be found at:
http://salk.edu/~preston/as/thumbnailer.html

This applescript droplet will batch process PICT, JPEG, or GIF files into thumbnails and full size images for use in HTML pages. It uses the great program clip2gif by Yves Piguet (piguet@ia.epfl.ch) as its conversion engine. Thumbnailer also writes an HTML index that can be used in cutting and pasting the HTML directly into your HTML documents.

This script is freely distributable for all non-commercial use.

Requirements

Getting the pieces:

What it does

Thumbnailer is an applescript droplet that will accept PICT, JPEG, or GIF files. It will then do the following three basic things (with a number of configurable parameters):

  1. Create subfolders for images
  2. Convert the source file into a full sized image (either JPEG or GIF) and create a scaled thumbnail for it (Using clip2gif).
  3. Write an HTML file that indexes the images with thumbnails linked to the full sized graphics.

Optionally Thumbnailer can also put the images in Tables and have the full sized images be on their own "Caption Page". See the section "Configuring Thumbnailer" for more information on setting options. If you are having problems check the section on known problems. You also can look at some examples of the output


How to use it:

When you first get thumbnailer, it is set up to use a standard configuration which will work for many people. There are a many other goodies you can set (as well as change most of the defaults), but I'll cover the basic operation assuming use of the defaults first.

Start by scanning in or saving your image files as PICT, JPEG, or GIF, for Thumbnailer to work properly they must end in ".pict", ".gif", or ".jpg" but should otherwise not have a period in the name. The file names should also not have any special characters including (:,",$,%,\). You may drag source files from anywhere on your hard drive onto Thumbnailer to be converted (they will be moved into a "sources" subfolder during conversion by default).

Thumbnailer will first prompt you for a place to put the subfolders: {"sources","gifs","jpgs"}, I'll call this location the Project Folder. Thumbnailer will then convert each dropped File into a GIF thumbnail (scaled to 30%) and a full sized JPEG and place these in the appropriate subfolders of the Project Folder, and will also move the dropped file into the "sources" subfolder.

In addition an HTML file will be written that containing the HTML for the thumbnails linked to the full sized images. If you want to convert more files after the initial conversion, just drop them on Thumbnailer and they will be added to the collection (in the Project Folder that you choose). When you have a sense of basic operation, look at the section on advanced usage.

Look at this outline of a sample project folder

Also take a look at these examples.


Since the "image-index.html" index written by Thumbnailer uses relative URLs for the pictures, the HTML can be copied and pasted from the index into your own HTML file as long as it resides in the same project folder. The project folder can be moved and the relative links will still work.

Another tip: You can end up with ready to use HTML if you name your files thoughtfully. The filename (minus any extension) is used for:

Therefore it is better to name a PICT file "Me and George" than "MandG". Remember not to use special characters, though spaces are OK and will be converted to underscores for use in final file names.


Configuring Thumbnailer

Thumbnailer is designed to be usable and useful "out of the box" but many of its most interesting features are turned off by default. Configuration parameters are stored in a Config file. By default this file is named "Thumbnailer.config" Multiple config files can be kept and used if they are given different names. Configuration files are text files and can be edited manually or by using the included "Configure Thumbnailer" program. Here is the order of what both "Thumbnailer" and "Configure Thumbnailer" look for when using config files:
  1. A file with the name "Thumbnailer.config" is looked for in the same folder as the application
  2. If one is not found the preferences folder is checked
  3. If "Thumbnailer.config" is not found the program will ask if you would like to locate one, and the "Configure Thumbnailer" program will also offer to create a new one (In the application folder)

Any config file (of any name) can also be dropped onto either application.

To edit the configuration file using "Configure Thumbnailer" double click on the application. To edit an alternative config file drop it onto the Configure program.


Here is a guide to the options available:

Thumbnailer will use the "Thumbnailer.config" file by default if it is found in one of the two standard places. If not you will be asked to locate a config file. To configure Thumbnailer with any config file simply drop it onto Thumbnailer.

See some examples of the variety you can get


Advanced Usage

Some functionality of Thumbnailer is not apparent at first. This section will introduce you to some of these uses.

Multiple config files

If you regularly work on several projects at the same time each of which has its own configurations, you can keep a seperate config file for each project. Simply make a copy of the "Thumbnailer.config" file and name it something else. To edit it drag it onto the "Configure Thumbnailer" app. To configure Thumbnailer with a given config file simply drop it onto Thumbnailer. If you have set Thumbnailer not to quit, it can be reconfigured by dropping additional config files on it. As a shortcut, a config file can be dropped at the same time as image files and those (and subsequent image files) will be configured with those parameters.

Manually editing config files

Although all options in a config file can be set with the "Configure Thumbnailer" program, editing config files by hand can be speedy and efficient in some situations. This can be done in any text editor. Available entries for each parameter are listed after the commented description of the parameter in the config file. Any additional comments you make in the config file will be erased if later edited using "Configure Thumbnailer".

Using caption pages and editing caption templates

One feature I personally like is the ability of Thumbnailer to create caption pages. Instead of linking the thumbnail to only the full sized image, thumbnails are linked to an HTML document that contains the full sized image as an inlined document. This is most usable by browser which support inlined images though a link to the image file itself can easily be provided. The advantage of caption pages is that a description can appear with the full sized image. The layout of the basic caption page is built into Thumbnailer, and the HTML can be edited once generated. However, you can also have multiple Caption page templates. Which template Thumbnailer uses is set in the config file. The template should include the three following markers which can appear multiple times in the template: Take a look at the included sample template, which is identical to the builtin caption page layout used by Thumbnailer.

Using Targets (Netscape only)

The target paramter is a Netscape addition to the Anchor tag. You can use it to target a link (in this case a full sized image or caption page) into a specific window or frame. The target is given a name and in this case the name of the target is "ThumbTarget". A new window will be created and all subsequent loading of full sized images will be targeted into that window (or frame) Targets can also be used in frames. See Netscape's documentation for more information on the use of the target parameter.
Thumbnailer is Drop-Me-A-Line-Ware, if you find it useful drop me a line.
I've done my best to try Thumbnailer under a variety of situations but there are just too many permutations. If you have any trouble please get in touch with me.

Current problems or Shortcomings:

Version History

Changes made...

New in 1.6

New in 1.5

New in 1.5b3

New in 1.5b2

New in 1.5b1

New in 1.0

Previous to 1.0


Preston Holmes
pholmes@ucsd.edu